﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Catering_Rules
{
    public class IntroduceNutrition
    {
        private readonly Catering_Operation.IntroduceNutrition dal = new Catering_Operation.IntroduceNutrition();
        public int DelNutritionType(string id)
        {
            return dal.DelNutritionType(id);
        }
        public int DeleteAllINByTypeId(string TypeId)
        {
            return dal.DeleteAllINByTypeId(TypeId);
        }
        public DataTable GetAll()
        {
            return dal.GetAll();
        }
        public bool AddNutritionType(string Content)
        {
            return dal.AddNutritionType(Content);
        }
        public DataRow GetINByID(int id)
        {
            DataTable dt = dal.GetINByID(id);
            DataRow dr = dt.NewRow();
            dr = dt.Rows[0];
            return dr;
        }

        public bool ISExistNutritionType(string Content)
        {
            return dal.ISExistNutritionType(Content);
        }

        public bool AddIN(Catering_Model.IntroduceNutritionDBInfo INInfo)
        {
            bool flag = false;
            int num = dal.AddIN(INInfo);
            if (num == 1)
            {
                flag = true;
            }
            return flag;
        }

        public bool DelIN(int id)
        {
            bool flag = false;
            int num = dal.DelIN(id);
            if (num == 1)
            {
                flag = true;
            }
            return flag;
        }

        public bool UpdateIN(string title, string cText, int id, int typeid)
        {
            bool flag = false;
            int num = dal.UpdateIN(title, cText, id, typeid);
            if (num == 1)
            {
                flag = true;
            }
            return flag;
        }
    }
}
